<?php
session_start();

if ($_POST['login'])
{
	extract($_POST);
    if($username=="bevthorne" && $password==)
    {
    	$_SESSION['admin'] = '1';
    }
}
if ($_POST['logout'])
{
    $_SESSION['admin'] = '0';
} 
include 'phpfunctions.php';
include('data/lib_f_pictures.php');
include('data/lib_f_validate.php');   
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bev's Tramping Gear Hire - Login</title>
<link href="template.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="container">
	<div id="header">	</div>
		<div id="nav">
    <?php include 'navbar.php';?>
    </div>
<div id="content">
<?php 
if($_SESSION['admin'])
{
	echo '<div align="center"><form action="'. $_SERVER['PHP_SELF'] .'" method="POST" enctype="multipart/form-data">
    <input type="submit" name="logout" id="logout" value="Logout" /></div>';
} else {
	echo '<form action="'.$_SERVER['PHP_SELF'] .'" method="POST" enctype="multipart/form-data">
  <label>
  <div align="center">username
    <input name="username" type="text" id="username" value="bevthorne" />
  </div>
  </label>
  <label>
  <div align="center">password
    <input type="password" name="password" id="password" />
     </div>
  <label>
  <div align="center">
    <input type="submit" name="login" id="login" value="Login" />
  </div>
  </label>
</form>';
}
?>
<p align="center"><a href="pricelist.php">New Price List</a></p>
    <p>&nbsp;</p>
  </div>
  <div align="center" class="style1" id="footer">
      <p><strong><a href="http://www.fiordland.org.nz/">Visit Destination Fiordland for all your information on Fiordland and Te Anau<br/>
      </a></strong></p>
      2007 webdesign by <a href="http://justcreations.co.nz">Justcreations</a> &amp; Brian Thorne, All rights reserved, Any technical problems email the <?php echo email_link('Brian', 'webmaster', 'Email Brian the webmaster','Enquiry from bevs-hire website'); ?>  </div>
</div>
</div>

</body>
</html>